//
//  WCExtractNumber.m
//  WebClipper
//
//  Created by Daniel Braun on 22/04/07.
//  Copyright 2007 __MyCompanyName__. All rights reserved.
//

#import "WCExtractNumber.h"
#import "StringExtension.h"

@implementation WCExtractNumber


+ (NSString *) description
{
	return @"convert to number";
}



- (id) initWithCoder:(NSCoder *) coder
{
	self=[super initWithCoder:coder];
	if ([coder allowsKeyedCoding]) {
	}
	return self;
}

- (void)encodeWithCoder:(NSCoder *)coder
{
	[super encodeWithCoder:coder];
	if ( [coder allowsKeyedCoding] ) {
	}
}

- (id) handle:(DOMHTMLElement *)el fromUrl:(NSURL *)url
{
	// convert to text, this is what super do
	NSString *s=[super handle:el  fromUrl:url];
	if (!s) return nil;
	NSAssert([s isKindOfClass:[NSString class]], @"should be string");
	NSNumber *n;
	n=[s numberSmartValue];
	if (!n) {
		NSLog(@"failed conversin\n");
	}
	return n;
}


@end
